﻿@model VoiceAd.Models.tblStation
@{
    ViewBag.Title = "Thêm mới nhà đài";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}
<script type="text/javascript">
    $(document).ready(function () {
        $("#ProvinceId").change(function () {
            var url = '@Url.Content("~/")' + "admincp/CatType_SelectedState";
            var ddlsource = "#ProvinceId";
            var ddltarget = "#DistrictId";
            $.getJSON(url, { id: $(ddlsource).val() }, function (data) {
                $(ddltarget).empty();
                $.each(data, function (index, optionData) {
                    $(ddltarget).append("<option value='" + optionData.Value + "'>" + optionData.Text + "</option>");
                });
            });
        });
    });
</script>
<h2>
    Thêm mới nhà đài</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Thông tin</legend>
        <div class="editor-label">
            Tên nhà đài
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.StationName)
            @Html.ValidationMessageFor(model => model.StationName)
        </div>
        <div class="editor-label">
            Tên đăng nhập
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.UserName)
            @Html.ValidationMessageFor(model => model.UserName)
        </div>
        <div class="editor-label">
            Email
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Email)
            @Html.ValidationMessageFor(model => model.Email)
        </div>
        <div class="editor-label">
            Tỉnh/Thành
        </div>
        <div class="editor-field">
            @Html.DropDownList("ProvinceId", (SelectList)ViewBag.lstProvince, new { style = "width: 150px" })
        </div>
        <div class="editor-label">
            Quận/huyện
        </div>
        <div class="editor-field">
            @Html.DropDownList("DistrictId", (SelectList)ViewBag.lstDistrict, new { style = "width: 150px" })
            @Html.ValidationMessageFor(model => model.DistrictId)
        </div>
        <div class="editor-label">
            Địa chỉ
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Address)
            @Html.ValidationMessageFor(model => model.Address)
        </div>
        <div class="editor-label">
            Số dân
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DanSo)
            @Html.ValidationMessageFor(model => model.DanSo)
        </div>
        <div class="editor-label">
            Số cụm loa
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.CumLoa)
            @Html.ValidationMessageFor(model => model.CumLoa)
        </div>
        <div class="editor-label">
            Đơn giá/ngày
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.UnitPrice)
            @Html.ValidationMessageFor(model => model.UnitPrice)
        </div>
        <div class="editor-label">
            Số xã
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SoXa)
            @Html.ValidationMessageFor(model => model.SoXa)
        </div>
        <div class="editor-label">
            Số lần phát sóng/ngày
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SoLan)
            @Html.ValidationMessageFor(model => model.SoLan)
        </div>
        <div class="editor-label">
            Ngày phát
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.NgayPhat)
            @Html.ValidationMessageFor(model => model.NgayPhat)
        </div>
        <div class="editor-label">
            Ghi chú
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.GhiChu)
            @Html.ValidationMessageFor(model => model.GhiChu)
        </div>
        <p>
            <input type="submit" value="Thêm mới" />
        </p>
    </fieldset>
}
<div>
    <a href="@Url.Content("~/station-1.html")">Quản lý đài phát thanh</a>
</div>
